<?php

class ApartmanBookingFormStep2 extends sfForm
{
    public function configure()
    {
        $this->setWidgets( array(
            'arrive_by'         => new sfWidgetFormSelect( array( 'choices' => array(
                                                                    'air' => 'Air',
                                                                    'bus' => 'Bus',
                                                                    'car' => 'Car',
                                                                    'sea' => 'Sea',
                                                                    'train' => 'Train',
                                                                    'other' => 'Other'
                                                                    )
                                                                )
                                                            ),
            'arrive_details'         => new sfWidgetFormInput(),
            'req_trans'                 => new sfWidgetFormInputCheckbox(),
            'comments'                 => new sfWidgetFormTextarea(),
            'suscribe'                 => new sfWidgetFormInputCheckbox( array( 'label' => __('suscribe_to') ) )                      
            )
        );
        
        $this->setValidators( array(
            'arrive_by'         => new sfValidatorString(array('max_length' => 5, 'required' => true)),
            'arrive_details'    =>  new sfValidatorString( array( 'max_length' => '200', 'required' => true ) ),
            'req_trans'         =>  new sfValidatorPass(),
            'comments'          =>  new sfValidatorString( array( 'max_length' => '255', 'required' => false ) ),            
            )
        );
        
        $this->widgetSchema->setNameFormat('booking_step2[%s]');
    
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);              
    }
}

?>